<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.prime.com.tr/ui"
      xmlns:ui="http://java.sun.com/jsf/facelets" >
<ui:composition template="/templates/principal.xhtml" >
<ui:define name="corpo" >
<h:head>
    <title>Processos no Setor</title>
    <h:outputScript library="js" name="tratardados.js" />
</h:head>
<h:body>
<p:growl id="mensagens" globalOnly="true" />
<p:panel header="Processos no Setor" style="text-align: center; height: 35px; padding: 0px; font-size: 16px"/>
<p:layout id="telaNoSetor" style="width: auto; height: 1024px;" >
    <p:layoutUnit position="left" collapsible="true" width="260" header="Processos no Setor">
            <p:tab title="Processos no Setor">
                <h:form id="graficosNoSetor"  >
                    <center>
                        <br />
                        <br />
                        <p:pieChart model="#{graficoBean.pieModelTotalProcessosNoSetor}" width="250px"  height="240px" style="piechartStyle" /> 
                    </center>
                </h:form>
            </p:tab>
    </p:layoutUnit>
    <p:layoutUnit scrollable="true" position="center" >
        <p:tabView activeIndex="0" effect="height" effectDuration="normal" >
        <p:tab title="Volumes">
            <h:form id="volumeProcessoNoSetor" prependId="false" style="overflow: auto;">
                <p:dataTable var="volumeProcesso" value="#{volumeProcessoBean.listarVolumesNoSetor}" emptyMessage="Não há informações!" 
                paginator="true" paginatorPosition="both" rows="15" selectionMode="single" paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"  
                rowsPerPageTemplate="5,15,30" style="overflow: auto;" >
                    <h:inputHidden value="#{volumeProcesso.idvolume}" />
                    <h:inputHidden value="#{volumeProcesso.idprocesso}" />
                    <p:column headerText="Detalhes" style="width: 5%" >
                        <center>
                            <p:commandLink title="Detalhes do processo" oncomplete="detalhesVolumeProcessoNoSetorDialog.show();" update="detalhesVolumeProcessoNoSetor"  immediate="true" >
                                <h:graphicImage library="imagens" name="detalhes_16.png" style="border:0"/>
                                <f:setPropertyActionListener target="#{volumeProcessoBean.volumeProcesso}" value="#{volumeProcesso}"  />
                            </p:commandLink>
                        </center>
                    </p:column>
                    <p:column headerText="PAG" filterBy="#{volumeProcesso.processo.pag}" >
                        <center>
                            <h:outputText value="#{volumeProcesso.processo.pag}" />
                        </center>
                    </p:column>
                    <!--
                    <p:column headerText="PAM" filterBy="#{volumeProcesso.processo.pam}" >
                        <center>
                            <h:outputText value="#{volumeProcesso.processo.pam}" />
                        </center>
                    </p:column>
                    -->
                    <p:column headerText="Vol." style="width: 5%" >
                        <center>
                            <h:outputText value="#{volumeProcesso.volume}" />
                        </center>
                    </p:column>
                    <p:column  headerText="Data de entrada" >
                        <center>
                            <h:outputText value="#{volumeProcesso.dataEntradaSetor}" >
                                <f:convertDateTime pattern="dd/MM/yyyy 'às' HH:mm:ss" locale="pt,BR" timeZone="America/Sao_Paulo" />
                            </h:outputText>
                        </center>
                    </p:column>
                    <p:column headerText="Encaminhado por" >
                        <center>
                            <h:outputText value="#{volumeProcesso.encaminhadoPor}" />
                        </center>
                    </p:column>
                    <p:column>
                        <center>
                            <p:commandButton value="Tramitações" immediate="true"  update="tramitacaoVolumeNoSetor" image="ui-icon ui-icon-transferthick-e-w" onclick="tramitacaoVolumeNoSetorDialog.show()" >
                                <f:setPropertyActionListener target="#{tramitacaoVolumeBean.volumeSelecionado}" value="#{volumeProcesso.idvolume}" />
                                <f:setPropertyActionListener target="#{tramitacaoVolumeBean.processoSelecionado}" value="#{volumeProcesso.idprocesso}" />
                            </p:commandButton>
                        </center>
                    </p:column> 
                    <p:column>
                        <center>
                            <p:commandButton value="Encaminhar" update="encaminharVolumeProcesso"  oncomplete="encaminharVolumeProcessoDialog.show()" image="ui-icon ui-icon-seek-next" disabled="#{contextoBean.usuarioLogado.tramita == false }" >
                                <f:setPropertyActionListener target="#{tramitacaoVolumeBean.volumeSelecionado}" value="#{volumeProcesso.idvolume}" />
                                <f:setPropertyActionListener target="#{tramitacaoVolumeBean.processoSelecionado}" value="#{volumeProcesso.idprocesso}" />
                            </p:commandButton>
                        </center>
                    </p:column>
                </p:dataTable>
            </h:form>
        </p:tab>
        <p:tab title="Anexos">
            <h:form id="anexoProcessoNoSetor" prependId="false" style="overflow: auto;">
                <p:dataTable var="anexoProcesso" value="#{anexoProcessoBean.listarAnexosNoSetor}" emptyMessage="Não há informações!"  
                paginator="true" paginatorPosition="both" rows="15" selectionMode="single" paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"  
                rowsPerPageTemplate="5,15,30" style="overflow: auto;">
                    <h:inputHidden value="#{anexoProcesso.idanexo}" />
                    <h:inputHidden value="#{anexoProcesso.idprocesso}" />
                    <p:column headerText="Detalhes" style="width: 5%" >
                        <center>
                            <p:commandLink title="Detalhes do processo" oncomplete="detalhesAnexoProcessoNoSetorDialog.show();" update="detalhesAnexoProcessoNoSetor" immediate="true" >
                                <h:graphicImage library="imagens" name="detalhes_16.png" style="border:0"/>
                                <f:setPropertyActionListener target="#{anexoProcessoBean.anexoProcesso}" value="#{anexoProcesso}"  />
                            </p:commandLink>
                        </center>
                    </p:column>
                    <p:column headerText="PAG" filterBy="#{anexoProcesso.processo.pag}" >
                        <center>
                            <h:outputText value="#{anexoProcesso.processo.pag}" />
                        </center>
                    </p:column>
                    <!--
                    <p:column headerText="PAM" filterBy="#{anexoProcesso.processo.pam}" >
                        <center>
                            <h:outputText value="#{anexoProcesso.processo.pam}" />
                        </center>
                    </p:column>
                    -->
                    <p:column headerText="Anexo" style="width: 5%" >
                        <center>
                            <h:outputText value="#{anexoProcesso.anexo}" />
                        </center>
                    </p:column>
                    <p:column  headerText="Data de entrada" >
                        <center>
                            <h:outputText value="#{anexoProcesso.dataEntradaSetor}" >
                                <f:convertDateTime pattern="dd/MM/yyyy 'às' HH:mm:ss" locale="pt,BR" timeZone="America/Sao_Paulo" />
                            </h:outputText>
                        </center>
                    </p:column>
                    <p:column headerText="Encaminhado por" >
                        <center>
                            <h:outputText value="#{anexoProcesso.encaminhadoPor}" />
                        </center>
                    </p:column>
                    <p:column>
                        <center>
                            <p:commandButton value="Tramitações" immediate="true"  update="tramitacaoAnexoNoSetor" image="ui-icon ui-icon-transferthick-e-w" onclick="tramitacaoAnexoNoSetorDialog.show()" >
                                <f:setPropertyActionListener target="#{tramitacaoAnexoBean.anexoSelecionado}" value="#{anexoProcesso.idanexo}" />
                                <f:setPropertyActionListener target="#{tramitacaoAnexoBean.processoSelecionado}" value="#{anexoProcesso.idprocesso}" />
                            </p:commandButton>
                        </center>
                    </p:column> 
                    <p:column>
                        <center>
                            <p:commandButton value="Encaminhar" update="encaminharAnexoProcesso" oncomplete="encaminharAnexoProcessoDialog.show()" image="ui-icon ui-icon-seek-next" disabled="#{contextoBean.usuarioLogado.tramita == false }" >
                                <f:setPropertyActionListener target="#{tramitacaoAnexoBean.anexoSelecionado}" value="#{anexoProcesso.idanexo}" />
                                <f:setPropertyActionListener target="#{tramitacaoAnexoBean.processoSelecionado}" value="#{anexoProcesso.idprocesso}" />
                            </p:commandButton>
                        </center>
                    </p:column>
                </p:dataTable>
            </h:form>
        </p:tab>
    </p:tabView>
    </p:layoutUnit>
    <p:layoutUnit position="right" width="250" header="Calendário" collapsible="true" >
            <p:tab title="Calendário" >
                <center>
                    <br/>
                    <br/>
                    <p:calendar mode="inline" navigator="none" alt="calendário" locale="pt,BR" timeZone="America/Sao_Paulo" />
                </center>
            </p:tab>
    </p:layoutUnit>
</p:layout>
</h:body>
    
<p:dialog header="Detalhes do processo" widgetVar="detalhesVolumeProcessoNoSetorDialog" resizable="false" modal="true" width="450" showEffect="explode" hideEffect="explode" >  
    <h:form id="detalhesVolumeProcessoNoSetor" prependId="false" >
        <h:inputHidden value="#{volumeProcessoBean.volumeProcesso.idprocesso}" />
        <p:fieldset>
        <center>
            <h:graphicImage library="imagens" name="logo.png" width="380" style="border:0" />
            <br />
            <hr />
            <h:outputLabel value="PAG #{volumeProcessoBean.volumeProcesso.processo.pag}" style="font-weight: bold; font-size: 14px"/>
        </center>
        <hr />
        <h:panelGrid columns="2" cellspacing="4" cellpadding="2">
            <h:outputLabel value="PAM:" style="font-weight: bold;" />
            <h:outputLabel value="#{volumeProcessoBean.volumeProcesso.processo.pam}" />
            <h:outputLabel value="Unidade do PAM:" style="font-weight: bold;" />
            <h:outputLabel value="#{volumeProcessoBean.volumeProcesso.processo.unidadeSolicitante}" >
                <f:converter converterId="ConverteUnidadeMilitarSiglaId"/>
            </h:outputLabel>
            <h:outputLabel value="Setor do PAM:" style="font-weight: bold;" />
            <h:outputLabel value="#{volumeProcessoBean.volumeProcesso.processo.setorSolicitante}" >
                <f:converter converterId="ConverteSetorSiglaId"/>
            </h:outputLabel>
            <h:outputLabel value="Data do PAG:" style="font-weight: bold;" />
            <h:outputLabel value="#{volumeProcessoBean.volumeProcesso.processo.dataProcesso}" >
                <f:convertDateTime dateStyle="medium" locale="pt,BR" timeZone="America/Sao_Paulo" />
            </h:outputLabel>
            <h:outputLabel value="Status" style="font-weight: bold;" />
            <h:outputLabel value="Ativo" rendered="#{volumeProcessoBean.volumeProcesso.processo.status == 1}" style="color: green; text-decoration: blink;" />
            <h:outputLabel value="Arquivado" rendered="#{volumeProcessoBean.volumeProcesso.processo.status == 2}" style="color: red;" />
            <h:outputLabel value="Objeto:" style="font-weight: bold;" />
            <h:outputLabel value="#{volumeProcessoBean.volumeProcesso.processo.objeto}" style="text-align: justify;"/>
            <h:outputLabel value="Cadastrado por:" style="font-weight: bold;" />
            <h:outputLabel value="#{volumeProcessoBean.volumeProcesso.processo.cadastradoPor}" style="text-align: justify;"/>
            <h:outputLabel value="Cadastrado em:" style="font-weight: bold;" />
            <h:outputLabel value="#{volumeProcessoBean.volumeProcesso.processo.dataCadastramento}" >
                <f:convertDateTime dateStyle="medium" locale="pt,BR" timeZone="America/Sao_Paulo" />
            </h:outputLabel>
            <h:outputLabel value="Motivo arquivamento:" style="font-weight: bold;" rendered="#{!empty volumeProcessoBean.volumeProcesso.processo.motivoArquivamento}" />
            <h:outputLabel value="#{volumeProcessoBean.volumeProcesso.processo.motivoArquivamento}" style="text-align: justify;" rendered="#{!empty volumeProcessoBean.volumeProcesso.processo.motivoArquivamento}" />
        </h:panelGrid>
        </p:fieldset>
        <br />
        <center>
            <p:commandButton oncomplete="detalhesVolumeProcessoNoSetorDialog.hide();" action="detalhesVolumeProcessoNoSetorDialog.hide();" value="Fechar"/>
        </center>
    </h:form>
</p:dialog>

<p:dialog header="Detalhes do processo" widgetVar="detalhesAnexoProcessoNoSetorDialog" resizable="false" modal="true" width="450" showEffect="explode" hideEffect="explode" >  
    <h:form id="detalhesAnexoProcessoNoSetor" prependId="false" >
        <h:inputHidden value="#{anexoProcessoBean.anexoProcesso.idprocesso}" />
        <p:fieldset>
        <center>
            <h:graphicImage library="imagens" name="logo.png" width="380" style="border:0" />
            <br />
            <hr />
            <h:outputLabel value="PAG #{anexoProcessoBean.anexoProcesso.processo.pag}" style="font-weight: bold; font-size: 14px"/>
        </center>
        <hr />
        <h:panelGrid columns="2" cellspacing="4" cellpadding="2">
            <h:outputLabel value="PAM:" style="font-weight: bold;" />
            <h:outputLabel value="#{anexoProcessoBean.anexoProcesso.processo.pam}" />
            <h:outputLabel value="Unidade do PAM:" style="font-weight: bold;" />
            <h:outputLabel value="#{anexoProcessoBean.anexoProcesso.processo.unidadeSolicitante}" >
                <f:converter converterId="ConverteUnidadeMilitarSiglaId"/>
            </h:outputLabel>
            <h:outputLabel value="Setor do PAM:" style="font-weight: bold;" />
            <h:outputLabel value="#{anexoProcessoBean.anexoProcesso.processo.setorSolicitante}" >
                <f:converter converterId="ConverteSetorSiglaId"/>
            </h:outputLabel>
            <h:outputLabel value="Data do PAG:" style="font-weight: bold;" />
            <h:outputLabel value="#{anexoProcessoBean.anexoProcesso.processo.dataProcesso}" >
                <f:convertDateTime dateStyle="medium" locale="pt,BR" timeZone="America/Sao_Paulo" />
            </h:outputLabel>
            <h:outputLabel value="Status" style="font-weight: bold;" />
            <h:outputLabel value="Ativo" rendered="#{anexoProcessoBean.anexoProcesso.processo.status == 1}" style="color: green; text-decoration: blink;" />
            <h:outputLabel value="Arquivado" rendered="#{anexoProcessoBean.anexoProcesso.processo.status == 2}" style="color: red;" />
            <h:outputLabel value="Objeto:" style="font-weight: bold;" />
            <h:outputLabel value="#{anexoProcessoBean.anexoProcesso.processo.objeto}" style="text-align: justify;"/>
            <h:outputLabel value="Cadastrado por:" style="font-weight: bold;" />
            <h:outputLabel value="#{anexoProcessoBean.anexoProcesso.processo.cadastradoPor}" style="text-align: justify;"/>
            <h:outputLabel value="Cadastrado em:" style="font-weight: bold;" />
            <h:outputLabel value="#{anexoProcessoBean.anexoProcesso.processo.dataCadastramento}" >
                <f:convertDateTime dateStyle="medium" locale="pt,BR" timeZone="America/Sao_Paulo" />
            </h:outputLabel>
            <h:outputLabel value="Motivo arquivamento:" style="font-weight: bold;" rendered="#{!empty anexoProcessoBean.anexoProcesso.processo.motivoArquivamento}" />
            <h:outputLabel value="#{anexoProcessoBean.anexoProcesso.processo.motivoArquivamento}" style="text-align: justify;" rendered="#{!empty anexoProcessoBean.anexoProcesso.processo.motivoArquivamento}" />
        </h:panelGrid>
        </p:fieldset>
        <br />
        <center>
            <p:commandButton oncomplete="detalhesAnexoProcessoNoSetorDialog.hide();" action="detalhesAnexoProcessoNoSetorDialog.hide();" value="Fechar"/>
        </center>
    </h:form>
</p:dialog>
    
<p:dialog header="Tramitações" widgetVar="tramitacaoVolumeNoSetorDialog" resizable="false" modal="true" width="960" showEffect="explode" hideEffect="explode" position="top">  
    <h:form id="tramitacaoVolumeNoSetor" prependId="false" >
        <h:inputHidden value="#{tramitacaoVolumeBean.tramitacaoVolume.idtramitaVolume}" />
        <center>
            <h:graphicImage library="imagens" name="logo.png" width="380" style="border:0" />
            <hr />
            <h:outputLabel value="PAG" style="font-weight: bold; font-size: 14px" />
            <h:outputLabel value="#{tramitacaoVolumeBean.processoSelecionado}" style="font-weight: bold; font-size: 14px" >
                 <f:converter converterId="ConverteIDtoPagId"/>
            </h:outputLabel>
        </center>
        <hr />
        <p:dataTable var="tramitaVolume" value="#{tramitacaoVolumeBean.listar}" emptyMessage="Não há informações!" 
            paginator="true" paginatorPosition="both" rows="15" paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"  
            rowsPerPageTemplate="5,15,30" style="overflow: auto;">
            <p:column headerText="OM remetente"  >
                <center>
                    <h:outputText value="#{tramitaVolume.unidadeRemetente}" title="Encaminhado por: #{tramitaVolume.remetente}"/>
                </center>
            </p:column>
            <p:column headerText="Setor remetente"  >
                <center>
                    <h:outputText value="#{tramitaVolume.setorRemetente}" />
                </center>
            </p:column>
            <p:column headerText="OM destino" style="width: 5%" >
                <center>
                    <h:outputText value="#{tramitaVolume.unidadeDestino}" />
                </center>
            </p:column>
            <p:column headerText="Setor destino" style="width: 5%" >
                <center>
                    <h:outputText value="#{tramitaVolume.setorDestino}" />
                </center>
            </p:column>
            <p:column headerText="Data despacho" style="width: 5%" >
                <center>
                <h:outputText value="#{tramitaVolume.dataTramitacao}" >
                    <f:convertDateTime pattern="dd/MM/yyyy 'às' HH:mm:ss" locale="pt,BR" timeZone="America/Sao_Paulo" />
                </h:outputText>
                </center>
            </p:column>
            <p:column headerText="Despacho" >
                <center>
                    <h:outputText value="#{tramitaVolume.despacho}" />
                </center>
            </p:column>
        </p:dataTable>
        <br />
        <center>
            <p:commandButton oncomplete="tramitacaoVolumeNoSetorDialog.hide();" action="tramitacaoVolumeNoSetorDialog.hide();" value="Fechar"/>
        </center>
    </h:form>
</p:dialog>
    
<p:dialog header="Tramitações" widgetVar="tramitacaoAnexoNoSetorDialog" resizable="false" modal="true" width="960" showEffect="explode" hideEffect="explode" position="top">  
    <h:form id="tramitacaoAnexoNoSetor" prependId="false" >
        <h:inputHidden value="#{tramitacaoAnexoBean.tramitacaoAnexo.idtramitaAnexo}" />
        <center>
            <h:graphicImage library="imagens" name="logo.png" width="380" style="border:0" />
            <hr />
            <h:outputLabel value="PAG" style="font-weight: bold; font-size: 14px" />
            <h:outputLabel value="#{tramitacaoAnexoBean.processoSelecionado}" style="font-weight: bold; font-size: 14px" >
                 <f:converter converterId="ConverteIDtoPagId"/>
            </h:outputLabel>
        </center>
        <hr />
        <p:dataTable var="tramitaAnexo" value="#{tramitacaoAnexoBean.listar}" emptyMessage="Não há informações!" 
            paginator="true" paginatorPosition="both" rows="15" paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"  
            rowsPerPageTemplate="5,15,30" style="overflow: auto;">
            <p:column headerText="OM remetente"  >
                <center>
                    <h:outputText value="#{tramitaAnexo.unidadeRemetente}" title="Encaminhado por: #{tramitaAnexo.remetente}"/>
                </center>
            </p:column>
            <p:column headerText="Setor remetente"  >
                <center>
                    <h:outputText value="#{tramitaAnexo.setorRemetente}" />
                </center>
            </p:column>
            <p:column headerText="OM destino" style="width: 5%" >
                <center>
                    <h:outputText value="#{tramitaAnexo.unidadeDestino}" />
                </center>
            </p:column>
            <p:column headerText="Setor destino" style="width: 5%" >
                <center>
                    <h:outputText value="#{tramitaAnexo.setorDestino}" />
                </center>
            </p:column>
            <p:column headerText="Data despacho" style="width: 5%" >
                <center>
                <h:outputText value="#{tramitaAnexo.dataTramitacao}" >
                    <f:convertDateTime pattern="dd/MM/yyyy 'às' HH:mm:ss" locale="pt,BR" timeZone="America/Sao_Paulo" />
                </h:outputText>
                </center>
            </p:column>
            <p:column headerText="Despacho" >
                <center>
                    <h:outputText value="#{tramitaAnexo.despacho}" />
                </center>
            </p:column>
        </p:dataTable>
        <br />
        <center>
            <p:commandButton oncomplete="tramitacaoAnexoNoSetorDialog.hide();" action="tramitacaoAnexoNoSetorDialog.hide();" value="Fechar"/>
        </center>
    </h:form>
</p:dialog>
    
<p:dialog header="Encaminhar" widgetVar="encaminharVolumeProcessoDialog" resizable="false" modal="true" width="480" showEffect="explode" hideEffect="explode" >  
    <h:form id="encaminharVolumeProcesso" prependId="false" >
        <p:fieldset>
        <center>
            <h:graphicImage library="imagens" name="logo.png" width="380" style="border:0" />
            <br />
            <hr />
            <h:outputLabel value="Processo nº #{tramitacaoVolumeBean.numeroPag}" style="font-weight: bold; font-size: 14px"/>
        </center>
        <hr />
        <h:panelGrid columns="3" cellspacing="4" cellpadding="2">
            <h:outputLabel value="Unidade destino:" for="unidade" />
            <h:selectOneMenu  id="unidade" value="#{tramitacaoVolumeBean.unidadeSelecionada}" valueChangeListener="#{setorBean.selecionaSetorPorOM}" >
                <f:selectItem itemValue="-1" itemLabel="Selecione"  />
                <f:selectItems value="#{unidadeMilitarBean.listarTipos}" var="it" itemValue="#{it.value}" itemLabel="#{it.key}" />
                <f:ajax execute="@this" render="setorP" event="change"  />
            </h:selectOneMenu>
            <br />
            <h:outputLabel value="Setor destino: " for="setorP" />
            <h:selectOneMenu id="setorP" value="#{tramitacaoVolumeBean.setorSelecionado}" immediate="true" >
                <f:selectItem itemValue="-1" itemLabel="Selecione"  />
                <f:selectItems value="#{setorBean.listarSetorPorOm}" var="item" itemValue="#{item.idsetor}" itemLabel="#{item.descricaoSetor}" />
            </h:selectOneMenu>
            <br />
            <h:outputLabel value="Despacho:" for="desp" />
        </h:panelGrid>
        <h:inputTextarea id="desp" value="#{tramitacaoVolumeBean.despacho}" cols="65" rows="8" />
        </p:fieldset>
        <br />
        <center>
            <p:commandButton value="Enviar" update="encaminharVolumeProcesso, volumeProcessoNoSetor, graficosNoSetor, mensagens" oncomplete="encaminharVolumeProcessoDialog.hide();" action="#{tramitacaoVolumeBean.encaminhar}" image="ui-icon ui-icon-disk" />
            <p:commandButton value="Cancelar" oncomplete="encaminharVolumeProcessoDialog.hide();" action="encaminharVolumeProcessoDialog.hide();" image="ui-icon ui-icon-close" ajax="true" />
        </center>
    </h:form>
</p:dialog>
    
<p:dialog header="Encaminhar" widgetVar="encaminharAnexoProcessoDialog" resizable="false" modal="true" width="480" showEffect="explode" hideEffect="explode" >  
    <h:form id="encaminharAnexoProcesso" prependId="false" >
        <p:fieldset>
        <center>
            <h:graphicImage library="imagens" name="logo.png" width="380" style="border:0" />
            <br />
            <hr />
            <h:outputLabel value="Processo nº #{tramitacaoAnexoBean.numeroPag}" style="font-weight: bold; font-size: 14px"/>
        </center>
        <hr />
        <h:panelGrid columns="3" cellspacing="4" cellpadding="2">
            <h:outputLabel value="Unidade destino:" for="unidadeA" />
            <h:selectOneMenu  id="unidadeA" value="#{tramitacaoAnexoBean.unidadeSelecionada}" valueChangeListener="#{setorBean.selecionaSetorPorOM}" >
                <f:selectItem itemValue="-1" itemLabel="Selecione"  />
                <f:selectItems value="#{unidadeMilitarBean.listarTipos}" var="it" itemValue="#{it.value}" itemLabel="#{it.key}" />
                <f:ajax execute="@this" render="setorA" event="change"  />
            </h:selectOneMenu>
            <br />
            <h:outputLabel value="Setor destino: " for="setorA" />
            <h:selectOneMenu id="setorA" value="#{tramitacaoAnexoBean.setorSelecionado}" immediate="true" >
                <f:selectItem itemValue="-1" itemLabel="Selecione"  />
                <f:selectItems value="#{setorBean.listarSetorPorOm}" var="item" itemValue="#{item.idsetor}" itemLabel="#{item.descricaoSetor}" />
            </h:selectOneMenu>
            <br />
            <h:outputLabel value="Despacho:" for="despA" />
        </h:panelGrid>
        <h:inputTextarea id="despA" value="#{tramitacaoAnexoBean.despacho}" cols="65" rows="8" />
        </p:fieldset>
        <br />
        <center>
            <p:commandButton value="Enviar" update="encaminharAnexoProcesso, anexoProcessoNoSetor, graficosNoSetor, mensagens" oncomplete="encaminharAnexoProcessoDialog.hide();" action="#{tramitacaoAnexoBean.encaminhar}" image="ui-icon ui-icon-disk" />
            <p:commandButton value="Cancelar" oncomplete="encaminharAnexoProcessoDialog.hide();" action="encaminharAnexoProcessoDialog.hide();" image="ui-icon ui-icon-close" ajax="true" />
        </center>
    </h:form>
</p:dialog>
</ui:define>
</ui:composition>
</html>